<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Android extends CI_Model {

    function login($log) {
        $this->db->where('username', $log['username']);
        $this->db->where('password', $log['password']);
        $data = $this->db->get('user');
        if ($data->num_rows == 1) {
            return $data->row();
        } else {
            return FALSE;
        }
    }

    function cekUsername($username) {
        $this->db->where('username', $username);
        $data = $this->db->get('user');
        return $data->num_rows();
    }

    function register($kirim) {
        $this->db->insert('user', $kirim);
    }

    function filaUpload($input) {
        $this->db->insert('file', $input);
    }

    function listFile($id) {
        $this->db->where('username', $id);
        $data = $this->db->get('file');
        if ($data->num_rows > 0) {
            return $data->result();
        }
    }

}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
